package com.qiaofang.repository;

import com.qiaofang.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface UserRepository extends JpaRepository<User, Long> {

    @Query(value = "from User u where u.userAccount = :userAccount and u.delFlag = '0' order by u.createTime desc ")
    User getUserByAccount(@Param(value = "userAccount") String userAccount);

}
